//
//  UIColor+extension.swift
//  WeiboTen
//
//  Created by ItHeiMa on 2017/7/18.
//  Copyright © 2017年 itHeima. All rights reserved.
//

import UIKit

extension UIColor {
    /// 返回一个随机颜色
    class func randomColor() -> UIColor {
        
        let r = Int(arc4random() % 255 + 1)
        let g = Int(arc4random() % 255 + 1)
        let b = Int(arc4random() % 255 + 1)
        
        return UIColor.rgb(r, g, b)
    }
    
    /// 返回一个rgb颜色
    class func rgb(_ r: Int, _ g: Int,_ b: Int, alpha: CGFloat = 1.0) -> UIColor {
        
        
        return UIColor(red: CGFloat(r)/255.0, green: CGFloat(g)/255.0, blue: CGFloat(b)/255.0, alpha: alpha)
    }
}



